Skip to content

feat: support external HLS sources with playlist management and player improvements#1530

Open
alexamirante wants to merge 33 commits into
mediacms-io:mainfrom
meetecho:feat/external-url
Open

feat: support external HLS sources with playlist management and player improvements#1530
alexamirante wants to merge 33 commits into
mediacms-io:mainfrom
meetecho:feat/external-url

Conversation

@alexamirante

@alexamirante alexamirante commented May 29, 2026

Copy link
Copy Markdown

Summary

This PR adds support for linking external HLS master playlist URLs as media
sources, without requiring a file upload. It also includes several improvements
to the media API, the upload/edit UX, and the video player.

New features

External HLS support

  • New external_hls_url URLField on the Media model (migration included)
  • Media created with an external HLS URL skips local file processing
    (media_init is not called)
  • The player reads the external URL through hls_info and original_media_url
  • Trim and Chapters controls are disabled in the UI for external HLS media
  • Managers can set duration for external HLS media via the API
  • New upload option in the user dashboard to submit an external HLS URL

Playlist management via API

  • playlist_ids field added to media POST/PUT endpoints, allowing callers
    to assign a media item to one or more playlists in a single request
  • The edit-media form now exposes playlist selection and syncs membership on save

Media API improvements

  • POST/PUT endpoints now accept enable_comments, allow_download, and
    tags fields
  • Caption/subtitle upload supported in media update (PUT)
  • uploaded_poster documented in Swagger for POST
  • Duplicate Swagger decorator and JSONParser issues fixed
  • Login schema generation conflict resolved

Player fixes

  • Absolute external media URLs handled correctly
  • Quality forcing supported for external HLS sources
  • Captions control shown for external HLS subtitle tracks

Regressions fixed

  • Subtitle files now pass the protected-media path auth check

Other

  • docker-compose.yaml: Admin credentials made configurable via environment variable
    (ADMIN_USER, ADMIN_EMAIL, ADMIN_PASSWORD)
  • Python __pycache__ directories added to .gitignore

Database migrations

A new migration 0019_media_external_hls_url adds the external_hls_url
field to the files_media table. It depends on 0018_embedmediacourse and
fits cleanly into the linear migration graph.

…sses

JSONParser in parser_classes conflicts with drf-yasg swagger generation when
form parameters (IN_FORM) are declared. The multipart form-data parsing works
fine with just MultiPartParser and FormParser, which are already present.

Fixes 500 errors when accessing /swagger/ endpoint.
- Remove 'duration' from read_only_fields in MediaSerializer
- In MediaList POST: accept 'duration' only when external_m3u8_url is
  also provided, restricted to managers/superusers
- In MediaDetail PUT: accept 'duration' only when the media already has
  an external_hls_url, restricted to managers/superusers
- Update swagger docs for both endpoints with duration parameter
…o 0019

Instead of a merge migration, renumber files/0015_media_external_hls_url
to files/0019_media_external_hls_url with dependency on 0018_embedmediacourse,
giving a clean linear migration graph.
Includes changes from main:
- Align upload UI visibility with CAN_ADD_MEDIA permissions
- Add configurable sidebar link visibility flags
- Add contact link visibility setting
- Gate My Playlists visibility by CAN_ADD_MEDIA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant